+2007-06-16 Richard Hult <richard@imendio.com>
+
+ * gdk/quartz/GdkQuartzWindow.c: (isInMove): Implement, to be used
+ to detect if the window is currently being moved with the mouse.
+
2007-06-16 Richard Hult <richard@imendio.com>
* gdk/quartz/gdkwindow-quartz.c (gdk_window_set_transient_for):
/* GdkQuartzWindow.m
*
- * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* Boston, MA 02111-1307, USA.
*/
-
#import "GdkQuartzWindow.h"
#include "gdkwindow-quartz.h"
#include "gdkprivate-quartz.h"
_gdk_quartz_events_update_focus_window (window, FALSE);
}
+/* Used in combination with NSLeftMouseUp in sendEvent to keep track
+ * of when the window is being moved with the mouse.
+ */
+-(void)windowWillMove:(NSNotification *)aNotification
+{
+ if (leftDown)
+ inMove = YES;
+}
+
+-(void)sendEvent:(NSEvent *)event
+{
+ switch ([event type])
+ {
+ case NSLeftMouseDown:
+ leftDown = YES;
+ break;
+
+ case NSLeftMouseUp:
+ leftDown = NO;
+ inMove = NO;
+ break;
+
+ default:
+ break;
+ }
+
+ [super sendEvent:event];
+}
+
+-(BOOL)isInMove
+{
+ return inMove;
+}
+
-(void)windowDidMove:(NSNotification *)aNotification
{
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
/* GdkQuartzWindow.h
*
- * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*/
#import <AppKit/AppKit.h>
-#include "gdkwindow.h"
+#include <glib.h>
@interface GdkQuartzWindow : NSWindow {
+ BOOL leftDown;
+ BOOL inMove;
}
+-(BOOL)isInMove;
+
@end